package org.tacademy.homework3;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class CustomerItemView extends LinearLayout {
	
	ImageView imageView;
	TextView text;
	
	public CustomerItemView(Context context) {
		super(context);
		init(context);
	}
	
	public CustomerItemView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}
	
	private void init(Context context){
		LayoutInflater inflater = (LayoutInflater)context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.customer, this,true);
		
		imageView = (ImageView)findViewById(R.id.imageview);
		text = (TextView)findViewById(R.id.text);
		
	}
	
	public void setName(String data){
		text.setText(data);
	}
	public void setImage(int data){
		imageView.setImageResource(data);
	}
}
